Skip to content

上传尽调资料文件

上传尽调资料文件

请求参数类型描述
due_diligence_idstring尽调单号
bodyobjectmultipart/form-data 数据结构
due_diligence_fileobject要上传的尽调资料文件
metastring媒体文件元信息,使用json表示
file_namestring商户上传的媒体图片的名称
file_digeststring图片文件的sha256摘要
sub_mchidstring子商户号
item_idnumber资料项唯一id
php
$media = new \WeChatPay\Util\MediaUtil('file:///path/to/image.jpg');
$media->setMeta(\json_encode([
  'file_name' => 'image.jpg',
  'file_digest' => 'your_image_file_sha256_string',
  'sub_mchid' => '1230001104',
  'item_id' => 130013
]));

$instance->v3->mchOperationManage->enhancedDueDiligence->_due_diligence_id_->upload->postAsync([
  'due_diligence_id' => '123000110_2_2190381dakdajois1283i12jo',
  'body' => $media->getStream(),
  'headers' => [
    'Content-Type' => $media->getContentType(),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$media = new \WeChatPay\Util\MediaUtil('file:///path/to/image.jpg');
$media->setMeta(\json_encode([
  'file_name' => 'image.jpg',
  'file_digest' => 'your_image_file_sha256_string',
  'sub_mchid' => '1230001104',
  'item_id' => 130013
]));

$instance->chain('v3/mch-operation-manage/enhanced-due-diligence/{due_diligence_id}/upload')->postAsync([
  'due_diligence_id' => '123000110_2_2190381dakdajois1283i12jo',
  'body' => $media->getStream(),
  'headers' => [
    'Content-Type' => $media->getContentType(),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$media = new \WeChatPay\Util\MediaUtil('file:///path/to/image.jpg');
$media->setMeta(\json_encode([
  'file_name' => 'image.jpg',
  'file_digest' => 'your_image_file_sha256_string',
  'sub_mchid' => '1230001104',
  'item_id' => 130013
]));

$instance['v3/mch-operation-manage/enhanced-due-diligence/{due_diligence_id}/upload']->postAsync([
  'due_diligence_id' => '123000110_2_2190381dakdajois1283i12jo',
  'body' => $media->getStream(),
  'headers' => [
    'Content-Type' => $media->getContentType(),
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$media = new \WeChatPay\Util\MediaUtil('file:///path/to/image.jpg');
$media->setMeta(\json_encode([
  'file_name' => 'image.jpg',
  'file_digest' => 'your_image_file_sha256_string',
  'sub_mchid' => '1230001104',
  'item_id' => 130013
]));

$response = $instance->v3->mchOperationManage->enhancedDueDiligence->_due_diligence_id_->upload->post([
  'due_diligence_id' => '123000110_2_2190381dakdajois1283i12jo',
  'body' => $media->getStream(),
  'headers' => [
    'Content-Type' => $media->getContentType(),
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$media = new \WeChatPay\Util\MediaUtil('file:///path/to/image.jpg');
$media->setMeta(\json_encode([
  'file_name' => 'image.jpg',
  'file_digest' => 'your_image_file_sha256_string',
  'sub_mchid' => '1230001104',
  'item_id' => 130013
]));

$response = $instance->chain('v3/mch-operation-manage/enhanced-due-diligence/{due_diligence_id}/upload')->post([
  'due_diligence_id' => '123000110_2_2190381dakdajois1283i12jo',
  'body' => $media->getStream(),
  'headers' => [
    'Content-Type' => $media->getContentType(),
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$media = new \WeChatPay\Util\MediaUtil('file:///path/to/image.jpg');
$media->setMeta(\json_encode([
  'file_name' => 'image.jpg',
  'file_digest' => 'your_image_file_sha256_string',
  'sub_mchid' => '1230001104',
  'item_id' => 130013
]));

$response = $instance['v3/mch-operation-manage/enhanced-due-diligence/{due_diligence_id}/upload']->post([
  'due_diligence_id' => '123000110_2_2190381dakdajois1283i12jo',
  'body' => $media->getStream(),
  'headers' => [
    'Content-Type' => $media->getContentType(),
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
file_idstring文件标识ID

参阅 官方文档

Published on the GitHub by TheNorthMemory